const mysql = require('mysql2');

// 数据库连接
const db = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '123456',
    database: 'dorm_management'
  });
  
  db.connect(err => {
    if (err) throw err;
    console.log('数据库连接成功');
  });
  module.exports = db;